/*
 * StartupGameState.java
 *
 * Created on May 15, 2007, 6:27 PM
 *
 * Copyright (c) 2007 Daniel Gronau
 *
 * This file is part of KanjiTori.
 *
 * KanjiTori is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * KanjiTori is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 *
 */

package kanjitori.gamestate;

import com.jme.scene.Node;
import com.jmex.game.state.BasicGameState;
import kanjitori.MainFrame;
import kanjitori.graphics.ortho.status.StartupScreen;

/**
 *
 * @author DGronau
 */
public class StartupGameState extends BasicGameState {
    
    private StartupScreen startupScreen;
    private int percent;
    
    /** Creates a new instance of StartupGameState */
    public StartupGameState() {
        super("loading");
        initDisplay();
    }

    private void initDisplay() {
        startupScreen = new StartupScreen(MainFrame.STARTUP_IMAGE);
        Node node = startupScreen.getNode();
        this.getRootNode().attachChild(node);
        node.updateRenderState();       
    }
    
    public void updateScreen(int percent, String text) {
        startupScreen.updateScreen(percent, text);
    }
    
    public int getPercent() {
        return percent;
    }
    
}
